The phrase "to throw the book" means to punish someone strictly and harshly according to the rules or laws written in a book or set of guidelines. It usually implies giving the maximum possible punishment.